<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <script type="text/javascript">var contextPath = "/EasyBuy";</script>
    <div class="soubg">
        <div class="sou">
            <!--Begin 所在收货地区 Begin-->
            <span class="s_city_b">
        	<span class="fl">送货至：</span>
            <span class="s_city">
            	<span>四川</span>
                <div class="s_city_bg">
                  <div class="s_city_t"></div>
                  <div class="s_city_c">
                    <h2>请选择所在的收货地区</h2>
                    <table border="0" class="c_tab" style="width:235px; margin-top:10px;" cellspacing="0" cellpadding="0">
                      <tr>
                        <th>A</th>
                        <td class="c_h"><span>安徽</span><span>澳门</span></td>
                      </tr>
                      <tr>
                        <th>B</th>
                        <td class="c_h"><span>北京</span></td>
                      </tr>
                      <tr>
                        <th>C</th>
                        <td class="c_h"><span>重庆</span></td>
                      </tr>
                      <tr>
                        <th>F</th>
                        <td class="c_h"><span>福建</span></td>
                      </tr>
                      <tr>
                        <th>G</th>
                        <td class="c_h"><span>广东</span><span>广西</span><span>贵州</span><span>甘肃</span></td>
                      </tr>
                      <tr>
                        <th>H</th>
                        <td class="c_h"><span>河北</span><span>河南</span><span>黑龙江</span><span>海南</span><span>湖北</span><span>湖南</span></td>
                      </tr>
                      <tr>
                        <th>J</th>
                        <td class="c_h"><span>江苏</span><span>吉林</span><span>江西</span></td>
                      </tr>
                      <tr>
                        <th>L</th>
                        <td class="c_h"><span>辽宁</span></td>
                      </tr>
                      <tr>
                        <th>N</th>
                        <td class="c_h"><span>内蒙古</span><span>宁夏</span></td>
                      </tr>
                      <tr>
                        <th>Q</th>
                        <td class="c_h"><span>青海</span></td>
                      </tr>
                      <tr>
                        <th>S</th>
                        <td class="c_h"><span>上海</span><span>山东</span><span>山西</span><span class="c_check">四川</span><span>陕西</span></td>
                      </tr>
                      <tr>
                        <th>T</th>
                        <td class="c_h"><span>台湾</span><span>天津</span></td>
                      </tr>
                      <tr>
                        <th>X</th>
                        <td class="c_h"><span>西藏</span><span>香港</span><span>新疆</span></td>
                      </tr>
                      <tr>
                        <th>Y</th>
                        <td class="c_h"><span>云南</span></td>
                      </tr>
                      <tr>
                        <th>Z</th>
                        <td class="c_h"><span>浙江</span></td>
                      </tr>
                    </table>
                  </div>
                </div>
            </span>
        </span>
         <!--End 所在收货地区 End-->
         <span class="fr" th:if="${session.user.loginName!=null}">
        	<span class="fl"><a href="userInfo" th:text="${session.user.userName}">用户名</a>&nbsp;|&nbsp;<a href="OrderShowAll">我的订单</a>&nbsp;|&nbsp;<a href="goindex" th:hidden="${session.user.getType()==1?false:true}">后台管理&nbsp;|&nbsp;</a><a href="exit.action">注销</a></span>
        </span>
        <span class="fr" th:if="${session.user.loginName==null}">
            <span class="fl">你好，请<a href="gologin"  style="color:#ff4e00;">登录</a>&nbsp;<a href="goRegist" style="color:#ff4e00;">免费注册</a>&nbsp;&nbsp;</span>
        </span>
        </div>
    </div>

    <link type="text/css" rel="stylesheet" href="http://127.0.0.1:8081/css/style.css"/>
    <script type="text/javascript" src="http://127.0.0.1:8081/js/jquery-1.11.1.min_044d0927.js"></script>
    <script type="text/javascript" src="http://127.0.0.1:8081/js/jquery.bxslider_e88acd1b.js"></script>
    <script type="text/javascript" src="http://127.0.0.1:8081/js/jquery-1.8.2.min.js"></script>
    <script type="text/javascript" src="http://127.0.0.1:8081/js/menu.js"></script>
    <script type="text/javascript" src="http://127.0.0.1:8081/js/select.js"></script>
    <script type="text/javascript" src="http://127.0.0.1:8081/js/lrscroll.js"></script>
    <script type="text/javascript" src="http://127.0.0.1:8081/js/iban.js"></script>
    <script type="text/javascript" src="http://127.0.0.1:8081/js/fban.js"></script>
    <script type="text/javascript" src="http://127.0.0.1:8081/js/f_ban.js"></script>
    <script type="text/javascript" src="http://127.0.0.1:8081/js/mban.js"></script>
    <script type="text/javascript" src="http://127.0.0.1:8081/js/bban.js"></script>
    <script type="text/javascript" src="http://127.0.0.1:8081/js/hban.js"></script>
    <script type="text/javascript" src="http://127.0.0.1:8081/js/tban.js"></script>
    <script type="text/javascript" src="http://127.0.0.1:8081/js/lrscroll_1.js"></script>
    <script type="text/javascript" src="http://127.0.0.1:8081/js/register.js"></script>
    <link rel="stylesheet" type="text/css" href="http://127.0.0.1:8081/css/ShopShow.css" />
    <link rel="stylesheet" type="text/css" href="http://127.0.0.1:8081/css/MagicZoom.css" />
    <script type="text/javascript" src="http://127.0.0.1:8081/js/MagicZoom.js"></script>
    <script type="text/javascript" src="http://127.0.0.1:8081/js/num.js"></script>
    <script type="text/javascript" src="http://127.0.0.1:8081/js/p_tab.js"></script>
    <script type="text/javascript" src="http://127.0.0.1:8081/js/shade.js"></script>
    <script type="text/javascript" src="http://127.0.0.1:8081/js/n_nav.js"></script>
    <script src="/EasyBuy/statics/js/cart/cart.js"></script>
    <title>易买网--商品列表</title>
</head>
<body>
<!--Begin Header Begin-->
<div id="searchBar">
    <script type="text/javascript">
        var contextPath = "/EasyBuy";
    </script>
    <div class="top">
        <div class="logo"><a href="indexShow"><img src="http://127.0.0.1:8070/logo.png" /></a></div>
        <div class="search">
            <!--输入商品名查询商品-->
            <form action="showProduct" method="post">
                <input name="epname" type="text" value="" class="s_ipt" th:value="${keywords}"/>
                <input type="submit" value="搜索" class="s_btn" />
            </form>
            <span class="fl"><a href="#">咖啡</a><a href="#">iphone13</a><a href="#">新鲜美食</a><a href="#">蛋糕</a><a href="#">日用品</a><a href="#">连衣裙</a></span>
        </div>
        <div class="i_car">
            <div class="car_t">购物车 [ <span th:text="${snum}">1</span> ]</div>
            <div class="car_bg">
                <!--Begin 购物车未登录 Begin-->
                <div class="un_login" th:hidden="${session.user.loginName==null?false:true}">还未登录！<a href="gologin" style="color:#ff4e00;">马上登录</a> 查看购物车！</div>
                <!--End 购物车未登录 End-->
                <!--Begin 购物车已登录 Begin-->
                <ul class="cars" th:hidden="${session.user.loginName==null?true:false}">
                    <li th:each="shopcar:${shopcars}" th:hidden="${shopcars==null?true:false}">
                        <div class="img"><a href="#"><img th:src="@{'http://127.0.0.1:8070/'+${shopcar.ep.fileName}}" width="58" height="58" /></a></div>
                        <div class="name"><a href="#" th:text="${shopcar.ep.name}">法颂浪漫梦境50ML 香水女士持久清新淡香 送2ML小样3只</a></div>
                        <div class="price"><font color="#ff4e00" th:text="'￥'+${shopcar.ep.price}">￥399</font> X<span th:text="${shopcar.number}">1</span></div>
                    </li>
                </ul>
                <div class="price_sum">共计&nbsp; <font color="#ff4e00">￥</font><span class="zj" th:text="${zj}">399</span></div>
                <div class="price_a"><a th:href="${zj==0?'indexShow':'jiesuan1'}" th:text="${zj==0?'购物车还是空的哦':'去购物车结算'}">去购物车结算</a></div>
                <!--End 购物车已登录 End-->
            </div>
        </div>
    </div>
    <!--End Header End-->
    <!--Begin Menu Begin-->
    <div class="menu_bg">
        <div class="menu">
            <!--Begin 商品分类详情 Begin-->
            <div class="nav">
                <div class="nav_t">全部商品分类</div>
                <div class="leftNav">
                    <ul>
                        <li th:each="epc,stat1:${epcs}" th:hidden="${stat1.index<10?false:true}">
                            <div class="fj">
                                <span class="n_img"><span></span><img th:src="@{'images/nav'+${stat1.index+1}+'.png'}" src="http://127.0.0.1:8070/nav1.png" /></span>
                                <span class="fl" th:text="${epc.name}">进口食品、生鲜s</span>
                                <!--<span class="fl"><a th:href="@{/selectEpsByEpcId(id=${epc.id})}" th:text="${epc.name}">进口食品、生鲜s</a></span>-->
                            </div>
                            <div class="zj" th:style="@{'top:'+${stat1.index*-40}+'px;'}">
                                <div class="zj_l">
                                    <div class="zj_l_c" th:each="epc2,stat2:${epc.getProList()}">

                                        <h2><a th:href="@{/selectEpsByEpcId(id=${epc2.id})}" th:text="${epc2.name}">零食 / 糖果 / 巧克力</a></h2>
                                        <a th:href="@{/selectEpsByEpcId(id=${epc3.id})}" th:each="epc3,stat3:${epc2.proList}" th:text="${epc3.name}+'&nbsp; |'">坚果</a>
                                    </div>
                                </div>
                                <div class="zj_r">
                                    <a href="#"><img src="http://127.0.0.1:8070/n_img1.jpg" width="236" height="200" /></a>
                                    <a href="#"><img src="http://127.0.0.1:8070/n_img2.jpg" width="236" height="200" /></a>
                                </div>
                            </div>
                        </li>
                    </ul>
                </div>
            </div>
            <!--End 商品分类详情 End-->
            <ul class="menu_r">
                <li><a href="indexShow">首页</a></li>
                <li th:each="ep,statep:${epcs}"><a th:href="@{/selectEpsByEpcId(id=${ep.id})}" th:if="${statep.index} lt '8'"  th:text="${ep.name}">首页</a></li>

            </ul>
            <div class="m_ad">中秋送好礼！</div>
        </div></div>
</div>
<!--End Menu End-->
<div class="i_bg">
    <!--Begin 筛选条件 Begin-->
    <!--End 筛选条件 End-->
    <div class="content mar_20">
        <div id="favoriteList">
        </div>
        <div class="l_list">
            <div class="list_t">
                <span class="fr">共发现<span th:text="${jijian}"></span><span th:text="${jijian2}"></span>件</span>
            </div>
            <div class="list_c">
                <ul class="cate_list">

                    <li th:each="sP:${showProduct}" th:if="${showProduct!=null}">
                        <div class="img">
                            <a th:href="@{/findProductByPid(pid=${sP.id})}" target="_blank">
                                <img th:src="@{'http://127.0.0.1:8070/'+${sP.fileName}}" width="210" height="185"/>
                            </a>
                        </div>
                        <div class="price">
                            <font>￥<span th:text="${sP.price}">53.0</span></font>
                        </div>
                        <div class="name"><a th:href="@{/findProductByPid(pid=${sP.id})}" th:text="${sP.name}">箱包</a></div>

                        <div class="carbg">
                            <input type="hidden" th:value="${sP.id}" class="pid">
                            <a class="ss" onclick="ShowDiv('MyDiv','fade')">关注商品</a>
                            <a class="j_car" onclick="ShowDiv_1('MyDiv1','fade1',jq(this))">加入购物车</a>
                        </div>
                    </li>

                    <li th:each="seps:${prods}" th:if="${seps!=null}">
                        <div class="img">
                            <a th:href="@{/findProductByPid(pid=${seps.id})}" target="_blank">
                                <img th:src="@{'http://127.0.0.1:8070/'+${seps.fileName}}" width="210" height="185"/>
                            </a>
                        </div>
                        <div class="price">
                            <font>￥<span th:text="${seps.price}">53.0</span></font>
                        </div>
                        <div class="name"><a th:href="@{/findProductByPid(pid=${seps.id})}" th:text="${seps.name}">箱包</a></div>

                        <div class="carbg">
                            <input type="hidden" th:value="${seps.id}" class="pid">
                            <a class="ss" onclick="ShowDiv('MyDiv','fade')">关注商品</a>
                            <a class="j_car" onclick="ShowDiv_1('MyDiv1','fade1',jq(this))">加入购物车</a>
                        </div>
                    </li>

                </ul>
                <script type="text/javascript">
                    var contextPath = "/EasyBuy";
                </script>
                <div class="pages">
                    <a href="#" class="p_pre">首页</a>
                    <a href="#" class="cur">1</a>
                    <a href="#" class="p_pre">尾页</a>
                </div>

            </div>
        </div>
    </div>
    <script>
        favoriteList();
    </script>
    <!--Begin 弹出层-收藏成功 Begin-->
    <div id="fade" class="black_overlay"></div>
    <div id="MyDiv" class="white_content">
        <div class="white_d">
            <div class="notice_t">
                <span class="fr" style="margin-top:10px; cursor:pointer;" onclick="CloseDiv('MyDiv','fade')"><img src="http://127.0.0.1:8070/close.gif" /></span>
            </div>
            <div class="notice_c">

                <table border="0" align="center" style="margin-top:0;" cellspacing="0" cellpadding="0">
                    <tr valign="top">
                        <td width="40"><img src="http://127.0.0.1:8070/suc.png" /></td>
                        <td>
                            <span style="color:#3e3e3e; font-size:18px; font-weight:bold;">您已成功收藏该商品</span><br />
                            <a href="#" onclick="CloseDiv('MyDiv','fade')">查看我的关注 >></a>
                        </td>
                    </tr>
                    <tr height="50" valign="bottom">
                        <td>&nbsp;</td>
                        <td><a href="#" class="b_sure" onclick="CloseDiv('MyDiv','fade')">确定</a></td>
                    </tr>
                </table>

            </div>
        </div>
    </div>
    <!--End 弹出层-收藏成功 End-->


    <!--Begin 弹出层-加入购物车 Begin-->
    <div id="fade1" class="black_overlay"></div>
    <div id="MyDiv1" class="white_content">
        <div class="white_d">
            <div class="notice_t">
                <span class="fr" style="margin-top:10px; cursor:pointer;" onclick="CloseDiv_1('MyDiv1','fade1')"><img src="http://127.0.0.1:8070/close.gif" /></span>
            </div>
            <div class="notice_c">

                <table border="0" align="center" style="margin-top:0;" cellspacing="0" cellpadding="0">
                    <tr valign="top">
                        <td width="40"><img src="http://127.0.0.1:8070/suc.png" /></td>
                        <td>
                            <span style="color:#3e3e3e; font-size:18px; font-weight:bold;">宝贝已成功添加到购物车</span><br />
                            购物车共有<span class="snum">1</span>种宝贝（<span id="shuliang">3</span>件） &nbsp; &nbsp; 合计：<span class="zj">1120</span>元
                        </td>
                    </tr>
                    <tr height="50" valign="bottom">
                        <td>&nbsp;</td>
                        <td><a href="jiesuan1" class="b_sure">去购物车结算</a><a href="indexShow" class="b_buy">继续购物</a></td>
                    </tr>
                </table>

            </div>
        </div>
    </div>
    <!--End 弹出层-加入购物车 End-->
    <div class="b_btm_bg b_btm_c" id="footer">
        <div class="b_btm">
            <table border="0" style="width:210px; height:62px; float:left; margin-left:75px; margin-top:30px;" cellspacing="0" cellpadding="0">
                <tr>
                    <td width="72"><img src="http://127.0.0.1:8070/b1.png" width="62" height="62" /></td>
                    <td><h2>正品保障</h2>正品行货  放心购买</td>
                </tr>
            </table>
            <table border="0" style="width:210px; height:62px; float:left; margin-left:75px; margin-top:30px;" cellspacing="0" cellpadding="0">
                <tr>
                    <td width="72"><img src="http://127.0.0.1:8070/b2.png" width="62" height="62" /></td>
                    <td><h2>满38包邮</h2>满38包邮 免运费</td>
                </tr>
            </table>
            <table border="0" style="width:210px; height:62px; float:left; margin-left:75px; margin-top:30px;" cellspacing="0" cellpadding="0">
                <tr>
                    <td width="72"><img src="http://127.0.0.1:8070/b3.png" width="62" height="62" /></td>
                    <td><h2>天天低价</h2>天天低价 畅选无忧</td>
                </tr>
            </table>
            <table border="0" style="width:210px; height:62px; float:left; margin-left:75px; margin-top:30px;" cellspacing="0" cellpadding="0">
                <tr>
                    <td width="72"><img src="http://127.0.0.1:8070/b4.png" width="62" height="62" /></td>
                    <td><h2>准时送达</h2>收货时间由你做主</td>
                </tr>
            </table>
        </div>
    </div>
    <div class="b_nav">
        <dl>
            <dt><a href="#">新手上路</a></dt>
            <dd><a href="#">售后流程</a></dd>
            <dd><a href="#">购物流程</a></dd>
            <dd><a href="#">订购方式</a></dd>
            <dd><a href="#">隐私声明</a></dd>
            <dd><a href="#">推荐分享说明</a></dd>
        </dl>
        <dl>
            <dt><a href="#">配送与支付</a></dt>
            <dd><a href="#">货到付款区域</a></dd>
            <dd><a href="#">配送支付查询</a></dd>
            <dd><a href="#">支付方式说明</a></dd>
        </dl>
        <dl>
            <dt><a href="#">会员中心</a></dt>
            <dd><a href="#">资金管理</a></dd>
            <dd><a href="#">我的收藏</a></dd>
            <dd><a href="#">我的订单</a></dd>
        </dl>
        <dl>
            <dt><a href="#">服务保证</a></dt>
            <dd><a href="#">退换货原则</a></dd>
            <dd><a href="#">售后服务保证</a></dd>
            <dd><a href="#">产品质量保证</a></dd>
        </dl>
        <dl>
            <dt><a href="#">联系我们</a></dt>
            <dd><a href="#">网站故障报告</a></dd>
            <dd><a href="#">购物咨询</a></dd>
            <dd><a href="#">投诉与建议</a></dd>
        </dl>
        <div class="b_tel_bg">
            <a href="#" class="b_sh1">新浪微博</a>
            <a href="#" class="b_sh2">腾讯微博</a>
            <p>
                服务热线：<br />
                <span>400-123-4567</span>
            </p>
        </div>
        <div class="b_er">
            <div class="b_er_c"><img src="http://127.0.0.1:8070/er.gif" width="118" height="118" /></div>
            <img src="http://127.0.0.1:8070/ss.png" />
        </div>
    </div>
    <div class="btmbg">
        <div class="btm">
            备案/许可证编号：蜀ICP备12009302号-1-www.dingguagua.com   Copyright © 2015-2018 尤洪商城网 All Rights Reserved. 复制必究 , Technical Support: Dgg Group <br />
            <img src="http://127.0.0.1:8070/b_1.gif" width="98" height="33" /><img src="http://127.0.0.1:8070/b_2.gif" width="98" height="33" /><img src="http://127.0.0.1:8070/b_3.gif" width="98" height="33" /><img src="http://127.0.0.1:8070/b_4.gif" width="98" height="33" /><img src="http://127.0.0.1:8070/b_5.gif" width="98" height="33" /><img src="http://127.0.0.1:8070/b_6.gif" width="98" height="33" />
        </div>
    </div>

</div>
</body>
<script type="text/javascript" th:inline="javascript">

    function ShowDiv_1(show_div,bg_div,dd){
        jQuery(".cars").html(" ");
        //var pid=this.getElementById("pid").value;
        var pid = dd.parent().find(".pid").val();
        var number=1;
        //alert(pid);
        jQuery.post("http://127.0.0.1:7070/addShopCar",{"pid":pid,"number":number},
            function (data) {
                var ss=jQuery(data.scs);
                var zongji=0;
                var shuliang=0;
                for(var i=0;i<ss.length;i++){
                    var div1="<li><div class='img'><a href='#'><img src='http://127.0.0.1:8070/"+ss[i].ep.fileName+"'width='58' height='58' /></a></div>\n<div class='name'><a href='#'>"+ss[i].ep.name+"</a></div>\n<div class='price'><font color='#ff4e00'>￥"+ss[i].ep.price+"</font> X"+ss[i].number+"</div>\n</li>";
                    jQuery(".cars").append(div1);
                    zongji=zongji+ss[i].xiaoji;
                    shuliang=shuliang+ss[i].number;
                }
                jQuery("#shuliang").text(shuliang);
                jQuery(".snum").text(ss.length);
                jQuery(".zj").text(zongji);
            },"json");
        document.getElementById(show_div).style.display='block';
        document.getElementById(bg_div).style.display='block' ;
        var bgdiv = document.getElementById(bg_div);
        bgdiv.style.width = document.body.scrollWidth;
        // bgdiv.style.height = $(document).height();
        $("#"+bg_div).height($(document).height());
    };


</script>
</html>
